import request from '@/utils/request'

export function userLogin(params) {
  return request({
    url: '/login',
    method: 'post',
    params
  })
}

export function loginOut(params) {
  return request({
    url: '/logout',
    method: 'post',
    params
  })
}

export function userInfo(params) {
  return request({
    url: '/user/userInfo',
    method: 'get',
    params
  })
}
export function updateUser(params) {
  return request({
    url: '/user/edit',
    method: 'post',
    params
  })
}

// 注册账号
export function register(params) {
  return request({
    url: '/user/add',
    method: 'post',
    params
  })
}
// 上传 并更新头像
export function uploadAvatar(params) {
  return request({
    url: '/user/uploadAvatar',
    method: 'post',
    params
  })
}

// 首页接口
export function productHome(params) {
  return request({
    url: '/product/home',
    method: 'get',
    params
  })
}
